﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace W5
{

    class Program
    {
        public struct PersonStruct
        {
            private string name;
            private int phone;
            private string address;
           public string Name
            {
                get { return name; }
                set { name = value; }
            }

            public int Phone {
                get { return phone; }
                set { phone = value; }
            }
            public string Address
            {
                get { return address; }
                set { address = value; }
            }



        }
        public struct PersonStruct2
        {
            private string name;
            private int phone;
            private string address;
            public string Name
            {
                get { return name; }
                set { name = value; }
            }

            public int Phone
            {
                get { return phone; }
                set { phone = value; }
            }
            public string Address
            {
                get { return address; }
                set { address = value; }
            }



        }

        static void Main(string[] args)
        {
            PersonStruct p1 = new PersonStruct();
            p1.Name = "小明";
            p1.Phone = 666666;
            p1.Address = "光禄勋街道";
            PersonStruct2 p2 = new PersonStruct2();
            p2.Name = "小张";
            p2.Phone = p1.Phone;
            p2.Address = p1.Address;
            Console.WriteLine("p1:{0} {1} {2}",p1.Name,p1.Phone,p1.Address);
            PersonClass p3 = new PersonClass();
            p3.name = "李四";
            p3.phone = 777;
            p3.address = "天堂街";
            PersonClass2 p4 = new PersonClass2();
            p4.name = "小四";
            p4.phone = p3.phone;
            p4.address = p3.address;
            Console.WriteLine("p3: {0} {1} {2}",p3.name,p3.phone,p3.address);
        }
 
    }
    class PersonClass {
        public string name;
        public int phone;
        public string address;

    }
    class PersonClass2
    {
        public string name;
        public int phone;
        public string address;

    }
}
